package com.qinsheng.infrastructure.persistent.dao;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import com.qinsheng.infrastructure.persistent.po.Award;
import com.qinsheng.infrastructure.persistent.po.RaffleActivityAccount;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * ClassName: IAwardDao
 * Description: 抽奖活动账户表
 *
 * @Author: qinsheng1900
 * @Create 2025/2/19 20:03
 * @Version 1.0
 */
@Mapper
public interface IRaffleActivityAccountDao {
    void insert(RaffleActivityAccount raffleActivityAccount);

    int updateAccountQuota(RaffleActivityAccount raffleActivityAccount);

    /**
     * 更新总库存（所有的，月，日）
     * @param build
     * @return 表示 SQL 语句执行后受影响的行数，如果是1，则表示有 1 行记录被成功更新
     */
    int updateActivityAccountSubtractionQuota(RaffleActivityAccount build);

    /**
     * 查询账户
     * @param raffleActivityAccountReq
     * @return
     */
    @DBRouter
    RaffleActivityAccount queryActivityAccountByUserId(RaffleActivityAccount raffleActivityAccountReq);

    /**
     * 更新总账户额度中的月额度镜像
     * @param raffleActivityAccountReq
     */
    void updateActivityAccountMonthSurplusImageQuota(RaffleActivityAccount raffleActivityAccountReq);

    /**
     * 更新总账户额度中的日额度镜像
     * @param raffleActivityAccountReq
     */
    void updateActivityAccountDaySurplusImageQuota(RaffleActivityAccount raffleActivityAccountReq);
}
